import 'package:boss/models/takeout_order_list_data.dart';
import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/page/takeoutManagement/page/takeoutList/widget/phone_icon.dart';

import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';
import 'package:flustars/flustars.dart' as flustars;

import 'message_row.dart';

class OrdererMessage extends StatelessWidget {
  final TakeoutOrderItem data;

  const OrdererMessage({Key key, this.data}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MessageRow(
      children: <Widget>[
        RichText(
          text: TextSpan(text: data.contactName, style: TextStyleConstant().normal_1_28, children: [
            WidgetSpan(child: SizedBox(width: 10.w)),
            TextSpan(text: data.sexText, style: TextStyleConstant().normal_2_24),
          ]),
        ),
        Text(
          !RegUtil.testNotEqEmpty(data.phoneNum) ? '--' : flustars.TextUtil.hideNumber(data.phoneNum),
          style: TextStyleConstant().blue_26,
        ),
        Text(
          '${data.addressDetail}',
          style: TextStyleConstant().normal_1_26,
        ),
      ],
      suffix: PhoneIcon(data.phoneNum),
    );
  }
}
